package com.h2cloud.JUCTest.TimeUtil;

import java.util.concurrent.TimeUnit;

/**
 * @Package: com.h2cloud.JUCTest
 * @ClassName: Sleeper
 * @Author: h2cloud
 * @CreateTime: 2022/5/29 9:59 上午
 * @Description:
 */
public class Sleeper {
	public static void sleep(int i) {
		try {
			TimeUnit.SECONDS.sleep(i);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	public static void sleep(double i) {
		try {
			TimeUnit.MILLISECONDS.sleep((int) (i * 1000));
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
